<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker%summernote')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('商品信息管理')"></div>
        <div th:replace="common/search::search('%add')"></div>
    </div>
</div>

<!--添加Goods模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">商品信息添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品名*
                                                </label>
                                                <div class="col-sm-10">
                                                    <input class="form-control" name="name" required
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品分类*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select onchange="gcsel(this.value)" class="form-control select2"
                                                            name="cid">
                                                        <option th:each="c:${gclist}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">成本价</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="minPrice" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品原价*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="price" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">拼团价*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="saleprice" required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">开始日期*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="dateStart" id="dateStart2" required
                                                           type="date" readonly/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">结束日期*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="dateEnd" required id="dateEnd2"
                                                           type="date" readonly/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品卖点</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control"
                                                           name="characteristic"
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">几人成团*</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control"
                                                           name="ptotal" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">产品类型*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="gtype">
                                                        <option value="1">实物产品</option>
                                                        <option value="2">虚拟产品</option>
                                                        <option value="3">到店服务</option>
                                                        <option value="4">上门服务</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">总库存数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="stores" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销类型*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type">
                                                        <option value="0">商城商品</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">兑换积分</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="jifen" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">分享奖励类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="shareBonusType">
                                                        <option value="0">分享无奖励</option>
                                                        <option value="1">送积分</option>
                                                        <option value="2">送现金</option>
                                                        <option value="3">送优惠券</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">奖励额</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="shareMount" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否支持会员余额交易</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isMember" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否支持积分抵扣交易</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isJifen" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否支持优惠券交易</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isCoupon" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否推荐商品</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isRecommend"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否热卖</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isHot" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">最大可扣除积分比例</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="maxUseJifen">
                                                        <option value="0">0</option>
                                                        <option value="0.1">10%</option>
                                                        <option value="0.2" selected>20%</option>
                                                        <option value="0.3">30%</option>
                                                        <option value="0.4">40%</option>
                                                        <option value="0.5">50%</option>
                                                        <option value="0.6">60%</option>
                                                        <option value="0.7">70%</option>
                                                        <option value="0.8">80%</option>
                                                        <option value="0.9">90%</option>
                                                        <option value="1">100%</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品重量</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <input name="weight" type="number" class="form-control"> <span
                                                            class="input-group-addon">Kg</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">限购数量</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <input class="form-control" id="xiangou2" name="xiangou"
                                                               type="number" value="0"/><span class="input-group-addon">0表示不限购</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品轮播图</label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" multiple type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">文字简介</label>
                                                <div class="col-sm-10">
                                                    <textarea name="jieshao" class="form-control"
                                                              maxlength="1000"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品详情</label>
                                                <div class="col-sm-10">
                                                    <input id="mfileinfo" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">包装清单</label>
                                                <div class="col-sm-10">
                                                    <input id="mfilepackinglist" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">售后服务</label>
                                                <div class="col-sm-10">
                                                    <input id="mfileafterservice" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">规格参数</label>
                                                <div class="col-sm-10">
                                                    <input id="mfileintroduction" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""/>
                                    <input id="hidinfo" name="info" type="hidden"/>
                                    <input id="hidpackinglist" name="packinglist" type="hidden"/>
                                    <input id="hidafterservice" name="afterservice" type="hidden"/>
                                    <input id="hidintroduction" name="introduction" type="hidden"/>
                                    <input name="type" type="1"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Goods模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">商品信息修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品名*
                                                </label>
                                                <div class="col-sm-10">
                                                    <input class="form-control" id="name" name="name"
                                                           required type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品分类*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select onchange="gcsel(this.value)" class="form-control select2"
                                                            name="cid" id="cid">
                                                        <option th:each="c:${gclist}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">成本价</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="minPrice" name="minPrice"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品原价*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="price" name="price"
                                                           required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">拼团价*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="saleprice" name="saleprice"
                                                           required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">开始日期*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="dateStart" name="dateStart" required
                                                           type="date" readonly/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">结束日期*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="dateEnd" name="dateEnd" required
                                                           type="date" readonly/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品卖点</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="characteristic"
                                                           name="characteristic"
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">几人成团*</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="ptotal"
                                                           name="ptotal" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">产品类型*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="gtype" id="gtype">
                                                        <option value="1">实物产品</option>
                                                        <option value="2">虚拟产品</option>
                                                        <option value="3">到店服务</option>
                                                        <option value="4">上门服务</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">总库存数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="stores" name="stores"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">已售</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="numberSale" name="numberSale"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">浏览次数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="views" name="views" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销类型*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type" id="type">
                                                        <option value="0">商城商品</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">兑换积分</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="jifen" name="jifen" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">分享奖励类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="shareBonusType"
                                                            id="shareBonusType">
                                                        <option value="0">分享无奖励</option>
                                                        <option value="1">送积分</option>
                                                        <option value="2">送现金</option>
                                                        <option value="3">送优惠券</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">奖励额</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="shareMount" name="shareMount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否支持会员余额交易</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isMember" name="isMember" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否支持积分抵扣交易</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isJifen" name="isJifen" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否支持优惠券交易</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isCoupon" name="isCoupon" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否推荐商品</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isRecommend" name="isRecommend"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否热卖</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isHot" name="isHot" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">最大可扣除积分比例</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="maxUseJifen" name="maxUseJifen">
                                                        <option value="0">0</option>
                                                        <option value="0.1">10%</option>
                                                        <option value="0.2" selected>20%</option>
                                                        <option value="0.3">30%</option>
                                                        <option value="0.4">40%</option>
                                                        <option value="0.5">50%</option>
                                                        <option value="0.6">60%</option>
                                                        <option value="0.7">70%</option>
                                                        <option value="0.8">80%</option>
                                                        <option value="0.9">90%</option>
                                                        <option value="1">100%</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品重量</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <input id="weight" name="weight" type="number"
                                                               class="form-control">
                                                        <span class="input-group-addon">Kg</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">限购数量</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="xiangou" name="xiangou"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品轮播图</label>
                                                <div class="col-sm-10">
                                                    <img id="previewPic" src='' class='file-preview-image' alt=''
                                                         title='' style="width: 100px;height: 100px;"/>
                                                    <input id="mfile2" name="mfile" multiple type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">文字简介</label>
                                                <div class="col-sm-10">
                                                    <textarea id="jieshao" name="jieshao" class="form-control"
                                                              maxlength="1000"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品详情</label>
                                                <div class="col-sm-10">
                                                    <img id="previewInfo" src='' class='file-preview-image' alt=''
                                                         title='' style="width: 100px;height: 100px;"/>
                                                    <input id="mfileinfo2" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">包装清单</label>
                                                <div class="col-sm-10">
                                                    <input id="mfilepackinglist2" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">售后服务</label>
                                                <div class="col-sm-10">
                                                    <input id="mfileafterservice2" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">规格参数</label>
                                                <div class="col-sm-10">
                                                    <input id="mfileintroduction2" name="mfile" multiple type="file"
                                                           class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic2" name="pic" type="hidden" value=""/>
                                    <input id="hidinfo2" name="info" type="hidden"/>
                                    <input id="hidpackinglist2" name="packinglist" type="hidden"/>
                                    <input id="hidafterservice2" name="afterservice" type="hidden"/>
                                    <input id="hidintroduction2" name="introduction" type="hidden"/>
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:include="common/footer_js::footer"></div>
<script>
    //图片上传
    function sendFile(file, editor, $editable) {

        var filename = false;
        try {
            filename = file['name'];
        } catch (e) {
            filename = false;
        }
        if (!filename) {
            $(".note-alarm").remove();
        }
        //以上防止在图片在编辑器内拖拽引发第二次上传导致的提示错误
        data = new FormData();
        data.append("mfile", file);
        data.append("key", filename); //唯一性参数
        $.ajax({
            data: data,
            type: "POST",
            url: "/upload/file?type=sn_Goods",
            cache: false,
            contentType: false,
            processData: false,
            success: function (e) {
                console.log(e)
                if (e && e.code != 0) {
                    swal({title: "上传失败", text: "", type: "error"})
                    return;
                } else {
                    swal({title: "上传成功", text: "", type: "success"})
                }
                editor.insertImage($editable, e.data);
                setTimeout(function () {
                    $(".note-alarm").remove();
                }, 5000);
            },
            error: function () {
                swal({title: "上传失败", text: "", type: "error"})
                return;
            }
        });
    }
</script>
<input id="isAdmin" type="hidden" th:value="${isAdmin}"/>
<script src="/js/admin/goods.js"></script>
</body>
</html>
